<?php
	/**
		Retrieves all active chats
		
		@author Joseph Fehrman
	*/
	$username = $_COOKIE['username'];
	include_once("../db/connection.php");
	
	//Query that pulls information from chatRoom
	echo "{";
	$sqlGetChatText = "Select chatID from chat_rel where username='$username'";
	$results = mysqli_query($conn, $sqlGetChatText) OR die("Error on query: " . $sql);
	$firstRun = 1;
	while ($row = mysqli_fetch_array($results, MYSQL_BOTH)){
		if($firstRun == 0){
			echo ", ";
		}
		$firstRun = 0;
		echo $row['chatID'];
	}
	echo "}";
	mysqli_close($conn);
?>